<?php

namespace Game\Helper;

/**
 * Calcula as penalidades para uma posição
 */
class PlayerPositionPenality {
    
    /**
     *
     */
    public static function goleiro($postion) {
        $field = array(FieldConstant::FIELD_1);
        return in_array($field, $postion);
    }

    /**
     *
     */
    public static function lateralEsquerda($postion) {
        $field = array(FieldConstant::FIELD_2, FieldConstant::FIELD_3, FieldConstant::FIELD_10, FieldConstant::FIELD_11);
        return in_array($field, $postion);
    }

    /**
     *
     */
    public static function lateralDireita($postion) {
        $field = array(FieldConstant::FIELD_7, FieldConstant::FIELD_8, FieldConstant::FIELD_15, FieldConstant::FIELD_16);
        return in_array($field, $postion);
    }

    /**
     *
     */
    public static function zagueiro($postion) {
        $field = array(FieldConstant::FIELD_4, FieldConstant::FIELD_5, FieldConstant::FIELD_6, FieldConstant::FIELD_12, FieldConstant::FIELD_13, FieldConstant::FIELD_14);
        return in_array($field, $postion);
    }

    /**
     *
     */
    public static function volante($postion) {
        $field = array(FieldConstant::FIELD_17, FieldConstant::FIELD_18, FieldConstant::FIELD_19, FieldConstant::FIELD_20, FieldConstant::FIELD_21, FieldConstant::FIELD_22, FieldConstant::FIELD_23, FieldConstant::FIELD_24, FieldConstant::FIELD_25, FieldConstant::FIELD_26, FieldConstant::FIELD_27, FieldConstant::FIELD_28, FieldConstant::FIELD_29, FieldConstant::FIELD_30);
        return in_array($field, $postion);
    }

    /**
     *
     */
    public static function meiaEsquerda($postion) {
        $field = array(FieldConstant::FIELD_24, FieldConstant::FIELD_25, FieldConstant::FIELD_31, FieldConstant::FIELD_32);
        return in_array($field, $postion);
    }

    /**
     *
     */
    public static function meiaDireita($postion) {
        $field = array(FieldConstant::FIELD_29, FieldConstant::FIELD_30, FieldConstant::FIELD_36, FieldConstant::FIELD_37);
        return in_array($field, $postion);
    }

    /**
     *
     */
    public static function meiaAtacante($postion) {
        $field = array(FieldConstant::FIELD_26, FieldConstant::FIELD_27, FieldConstant::FIELD_28, FieldConstant::FIELD_33, FieldConstant::FIELD_34, FieldConstant::FIELD_35);
        return in_array($field, $postion);
    }

    /**
     *
     */
    public static function pontaEsquerda($postion) {
        $field = array(FieldConstant::FIELD_38, FieldConstant::FIELD_39, FieldConstant::FIELD_45, FieldConstant::FIELD_46);
        return in_array($field, $postion);
    }

    /**
     *
     */
    public static function pontaDireita($postion) {
        $field = array(FieldConstant::FIELD_43, FieldConstant::FIELD_44, FieldConstant::FIELD_50, FieldConstant::FIELD_51);
        return in_array($field, $postion);
    }

    /**
     *
     */
    public static function centroavante($postion) {
        $field = array(FieldConstant::FIELD_40, FieldConstant::FIELD_41, FieldConstant::FIELD_42, FieldConstant::FIELD_47, FieldConstant::FIELD_48, FieldConstant::FIELD_49);
        return in_array($field, $postion);
    }
}
